
//80Hz	250Hz	500Hz	1KHz	2KHz	4KHz	10KHz
//Flat:0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C
//Rock:0x12,0x10,0x0e,0x0e,0x0C,0x0A,0x08
//CLassical:0x12,0x10,0x0e,0x0c,0x0a,0x08,0x06
//Acoustic:0x10,0x0e,0x0a,0x0a,0x08,0x08,0x08
//Dance:0x0e,0x0e,0x0c,0x0c,0x0a,0x08,0x08
//Electronical:0x0e,0x0c,0x0a,0x0a,0x08,0x04,0x02
//HipHop:0x18,0x16,0x14,0x12,0x10,0x0e,0x0a
//Custom:0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C
const eqlist={
    Flat:[12,12,12,12,12,12,12],
    Rock:[12,16,14,14,12,16,8],
    Classical:[12,16,14,12,10,8,6],
    Acoustic:[16,14,10,10,8,8,8],
    Dance:[14,14,12,12,10,8,8],
    Electronical:[14,12,10,10,8,4,2],
    HipHop:[24,22,20,18,16,14,10],
    Custom:[12,12,12,12,12,12,12]
}
let lock=false;
let eqorder=7;
const inputs=document.getElementsByClassName("input");
const eq_button=document.querySelectorAll(".eq-custom-button .iconfont")
const eq_custom=document.getElementsByClassName("text")[0]
window.onload=()=>{
  eq_button[0].num=-1;
  eq_button[1].num=1;
eq_button[0].onclick=changeeqlist;
eq_button[1].onclick=changeeqlist;
 for(var obj of inputs){
        obj.oninput=movethumb;
    }
}
function changeeqlist(){
    eqorder=eqorder+this.num;//-1/+1
    eqorder>=8?eqorder=0:eqorder;eqorder<0?eqorder=7:eqorder;
    console.log(eqorder) 
    if(eqorder==7){
        lock=false;
    }else{
        lock=true;
    }
    console.log(lock)
    var x=0;
    for(var obj of inputs){
        if(lock==true){
            obj.disabled=true;
        }else{
            obj.disabled=false
        }
        obj.value=eqlist[Object.keys(eqlist)[eqorder]][x];
        obj.style.backgroundSize=`2vw ${parseInt(obj.value)+2}vw`
        eq_custom.innerText=Object.keys(eqlist)[eqorder];
        x++;
    }
   
}
function movethumb(){
   this.style.backgroundSize=`2vw ${parseInt(this.value)+2}vw`
}